package com.sgb.link.entity;

import android.os.Parcel;
import android.os.Parcelable;


/**
 * 用户权限实体类
 */
public class PermissionEntity implements Parcelable {

    private boolean hasCar;//是否有车辆
    private boolean hasTeam;//是否有团队认证
    private String realName;//真名
    private String idCard;//身份证
    private String userNo;
    private String imAccount;//网易云账号
    private String imToken;//网易云token
    private String telPhone;//手机号
    private String headImg;//头像
    private int isRealName;//0：未实名，1：已实名
    private String companyNo;//公司no
    private boolean hasCompany;//是否有公司
    private boolean isJoinCompany;//是否有加入公司
    private boolean isOpenFundsAccount;//是否企业开通资金账户
    private boolean isDriverOpenFundsAccount;//是否个人开通资金账户
    private int userType;

    public PermissionEntity() {
    }

    protected PermissionEntity(Parcel in) {
        hasCar = in.readByte() != 0;
        hasTeam = in.readByte() != 0;
        realName = in.readString();
        idCard = in.readString();
        userNo = in.readString();
        imAccount = in.readString();
        imToken = in.readString();
        telPhone = in.readString();
        headImg = in.readString();
        isRealName = in.readInt();
        companyNo = in.readString();
        hasCompany = in.readByte() != 0;
        isJoinCompany = in.readByte() != 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte((byte) (hasCar ? 1 : 0));
        dest.writeByte((byte) (hasTeam ? 1 : 0));
        dest.writeString(realName);
        dest.writeString(idCard);
        dest.writeString(userNo);
        dest.writeString(imAccount);
        dest.writeString(imToken);
        dest.writeString(telPhone);
        dest.writeString(headImg);
        dest.writeInt(isRealName);
        dest.writeString(companyNo);
        dest.writeByte((byte) (hasCompany ? 1 : 0));
        dest.writeByte((byte) (isJoinCompany ? 1 : 0));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<PermissionEntity> CREATOR = new Creator<PermissionEntity>() {
        @Override
        public PermissionEntity createFromParcel(Parcel in) {
            return new PermissionEntity(in);
        }

        @Override
        public PermissionEntity[] newArray(int size) {
            return new PermissionEntity[size];
        }
    };


    public boolean isHasCar() {
        return hasCar;
    }

    public void setHasCar(boolean hasCar) {
        this.hasCar = hasCar;
    }

    public boolean isHasTeam() {
        return hasTeam;
    }

    public void setHasTeam(boolean hasTeam) {
        this.hasTeam = hasTeam;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getUserNo() {
        return userNo;
    }

    public void setUserNo(String userNo) {
        this.userNo = userNo;
    }

    public String getImAccount() {
        return imAccount;
    }

    public void setImAccount(String imAccount) {
        this.imAccount = imAccount;
    }

    public String getImToken() {
        return imToken;
    }

    public void setImToken(String imToken) {
        this.imToken = imToken;
    }

    public String getTelPhone() {
        return telPhone;
    }

    public void setTelPhone(String telPhone) {
        this.telPhone = telPhone;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public int getIsRealName() {
        return isRealName;
    }

    public void setIsRealName(int isRealName) {
        this.isRealName = isRealName;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public boolean isHasCompany() {
        return hasCompany;
    }

    public void setHasCompany(boolean hasCompany) {
        this.hasCompany = hasCompany;
    }

    public boolean isJoinCompany() {
        return isJoinCompany;
    }

    public void setJoinCompany(boolean joinCompany) {
        isJoinCompany = joinCompany;
    }

    public boolean isOpenFundsAccount() {
        return isOpenFundsAccount;
    }

    public void setOpenFundsAccount(boolean openFundsAccount) {
        isOpenFundsAccount = openFundsAccount;
    }

    public boolean isDriverOpenFundsAccount() {
        return isDriverOpenFundsAccount;
    }

    public void setDriverOpenFundsAccount(boolean driverOpenFundsAccount) {
        isDriverOpenFundsAccount = driverOpenFundsAccount;
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }
}

